Integrity of communications between blockchain networks and external data sources

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for enhancing blockchain network security. Embodiments include generating a request for data from a data source, the request including plaintext data and encrypted data, the encrypted data including access data and a hash of the plaintext data, transmitting the request to a relay system component external to the blockchain network, receiving a result from the relay system component that is digitally signed using a private key of the relay system component, and verifying an integrity of the result based on a public key of the relay system component and a digital signature of the result.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/714,460, now allowed, filed on Dec. 13, 2019, which is a continuationof PCT Application No. PCT/CN2019/096032, filed on Jul. 15, 2019, and acontinuation in part of PCT Application No. PCT/CN2019/079800, filed onMar. 27, 2019 and PCT Application No. PCT/CN2019/080478, filed on Mar.29, 2019, each of which is hereby incorporated by reference in itsentirety.

TECHNICAL FIELD

This specification relates to providing data to a blockchain networkfrom an external data source.

BACKGROUND

Distributed ledger systems (DLSs), which can also be referred to asconsensus networks, and/or blockchain networks, enable participatingentities to securely, and immutably store data. DLSs are commonlyreferred to as blockchain networks without referencing any particularuse case. An example of a type of blockchain network can includeconsortium blockchain networks provided for a select group of entities,which control the consensus process, and includes an access controllayer.

Smart contracts are programs that execute within blockchain networks. Insome instances, the smart contract running on the blockchain requiresinput from outside of the blockchain to evaluate pre-defined rules andperform corresponding actions. However, the smart contract itself cannotdirectly access external data sources. Consequently, a relay agent canbe used to retrieve external data, and submit the data to the blockchainfor processing by the smart contract. This process, however, can resultin security issues, such as leakage of secure information (e.g.,credentials that might be required to access an external data source).

Although techniques have been proposed for addressing security issuesassociated with data retrieval from external data sources, a moreeffective solution to address the security issues would be advantageous.

SUMMARY

This specification describes technologies for retrieval of data fromexternal data sources for processing within a blockchain network.Embodiments of this specification are directed to a system thatcoordinates communication from a user computing device through ablockchain network to an Internet-based data source that is external tothe blockchain network. More particularly, embodiments of thisspecification enable the user computing device to encrypt confidentialinformation that may be required to access the Internet-based data usinga public key of a relay system node that is used to query theInternet-based data source. In some embodiments, the relay system nodeencrypts a response using a private key, and the response is verified bythe user computing device using the public key. In some embodiments, therelay system node executes a trusted execution environment (TEE), andthe public key and the private key are provided through an attestationprocess of the TEE.

This specification also provides one or more non-transitorycomputer-readable storage media coupled to one or more processors andhaving instructions stored thereon which, when executed by the one ormore processors, cause the one or more processors to perform operationsin accordance with embodiments of the methods provided herein.

This specification further provides a system for implementing themethods provided herein. The system includes one or more processors, anda computer-readable storage medium coupled to the one or more processorshaving instructions stored thereon which, when executed by the one ormore processors, cause the one or more processors to perform operationsin accordance with embodiments of the methods provided herein.

It is appreciated that methods in accordance with this specification mayinclude any combination of the aspects and features described herein.That is, methods in accordance with this specification are not limitedto the combinations of aspects and features specifically describedherein, but also include any combination of the aspects and featuresprovided.

The details of one or more embodiments of this specification are setforth in the accompanying drawings and the description below. Otherfeatures and advantages of this specification will be apparent from thedescription and drawings, and from the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating an example of an environment that canbe used to execute embodiments of this specification.

FIG. 2 is a diagram illustrating an example of a conceptual architecturein accordance with embodiments of this specification.

FIG. 3 is a diagram illustrating an example of a system in accordancewith embodiments of this specification.

FIG. 4 is a signal flow illustrating an example of a process inaccordance with embodiments of this specification.

FIG. 5 is a diagram illustrating an example of a system in accordancewith embodiments of this specification.

FIG. 6 a signal flow illustrating an example of a process in accordancewith embodiments of this specification.

FIG. 7 is a flow chart illustrating an example of a process that can beexecuted in accordance with embodiments of this specification.

FIG. 8 is a diagram illustrating an example of modules of an apparatusin accordance with embodiments of this specification.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

This specification describes technologies for retrieval of data fromexternal data sources for processing within a blockchain network.Embodiments of this specification are directed to a system thatcoordinates communication from a user computing device through ablockchain network to an Internet-based data source that is external tothe blockchain network. More particularly, embodiments of thisspecification enable the user computing device to encrypt confidentialinformation that may be required to access the Internet-based datasource using a public key of a relay system node that is used to querythe Internet-based data source. In some embodiments, the relay systemnode encrypts a response using a private key, and the response isverified by the user computing device using the public key. In someembodiments, the relay system node executes a trusted executionenvironment (TEE), and the public key and the private key are providedthrough an attestation process of the TEE.

The techniques described in this specification produce several technicaleffects. For example, embodiments of this specification ensure theintegrity of requests submitted by a user computing device to relaysystem nodes for querying data sources that are external to a blockchainnetwork. As another example, embodiments of this specification ensurethe integrity of responses provided back to the blockchain network fromthe external data sources. Accordingly, embodiments of the presentdisclosure improve the integrity of communications between a usercomputing device and a relay system node through a blockchain network.In this manner, potential attack channels for malicious users aremitigated to enhance security.

To provide further context for embodiments of this specification, and asintroduced above, distributed ledger systems (DLSs), which can also bereferred to as consensus networks (e.g., made up of peer-to-peer nodes),and blockchain networks, enable participating entities to securely, andimmutably conduct transactions, and store data. Although the termblockchain is generally associated with particular networks, and/or usecases, blockchain is used herein to generally refer to a DLS withoutreference to any particular use case.

A blockchain is a data structure that stores transactions in a way thatthe transactions are immutable. Thus, transactions recorded on ablockchain are reliable and trustworthy. A blockchain includes one ormore blocks. Each block in the chain is linked to a previous blockimmediately before it in the chain by including a cryptographic hash ofthe previous block. Each block also includes a timestamp, its owncryptographic hash, and one or more transactions. The transactions,which have already been verified by the nodes of the blockchain network,are hashed and encoded into a Merkle tree. A Merkle tree is a datastructure in which data at the leaf nodes of the tree is hashed, and allhashes in each branch of the tree are concatenated at the root of thebranch. This process continues up the tree to the root of the entiretree, which stores a hash that is representative of all data in thetree. A hash purporting to be of a transaction stored in the tree can bequickly verified by determining whether it is consistent with thestructure of the tree.

Whereas a blockchain is a decentralized or at least partiallydecentralized data structure for storing transactions, a blockchainnetwork is a network of computing nodes that manage, update, andmaintain one or more blockchains by broadcasting, verifying andvalidating transactions, etc. As introduced above, a blockchain networkcan be provided as a public blockchain network, a private blockchainnetwork, or a consortium blockchain network. Embodiments of thisspecification are described in further detail herein with reference to aconsortium blockchain network. It is contemplated, however, thatembodiments of this specification can be realized in any appropriatetype of blockchain network.

In general, a consortium blockchain network is private among theparticipating entities. In a consortium blockchain network, theconsensus process is controlled by an authorized set of nodes, which canbe referred to as consensus nodes, one or more consensus nodes beingoperated by a respective entity (e.g., a financial institution,insurance company). For example, a consortium of ten (10) entities(e.g., financial institutions, insurance companies) can operate aconsortium blockchain network, each of which operates at least one nodein the consortium blockchain network.

In some examples, within a consortium blockchain network, a globalblockchain is provided as a blockchain that is replicated across allnodes. That is, all consensus nodes are in perfect state consensus withrespect to the global blockchain. To achieve consensus (e.g., agreementto the addition of a block to a blockchain), a consensus protocol isimplemented within the consortium blockchain network. For example, theconsortium blockchain network can implement a practical Byzantine faulttolerance (PBFT) consensus, described in further detail below.

FIG. 1 is a diagram illustrating an example of an environment 100 thatcan be used to execute embodiments of this specification. In someexamples, the environment 100 enables entities to participate in aconsortium blockchain network 102. The environment 100 includescomputing devices 106, 108, and a network 110. In some examples, thenetwork 110 includes a local area network (LAN), wide area network(WAN), the Internet, or a combination thereof, and connects web sites,user devices (e.g., computing devices), and back-end systems. In someexamples, the network 110 can be accessed over a wired and/or a wirelesscommunications link. In some examples, the network 110 enablescommunication with, and within the consortium blockchain network 102. Ingeneral the network 110 represents one or more communication networks.In some cases, the computing devices 106, 108 can be nodes of a cloudcomputing system (not shown), or each computing device 106, 108 can be aseparate cloud computing system including a number of computersinterconnected by a network and functioning as a distributed processingsystem.

In the depicted example, the computing systems 106, 108 can each includeany appropriate computing system that enables participation as a node inthe consortium blockchain network 102. Examples of computing devicesinclude, without limitation, a server, a desktop computer, a laptopcomputer, a tablet computing device, and a smartphone. In some examples,the computing systems 106, 108 host one or more computer-implementedservices for interacting with the consortium blockchain network 102. Forexample, the computing system 106 can host computer-implemented servicesof a first entity (e.g., user A), such as a transaction managementsystem that the first entity uses to manage its transactions with one ormore other entities (e.g., other users). The computing system 108 canhost computer-implemented services of a second entity (e.g., user B),such as a transaction management system that the second entity uses tomanage its transactions with one or more other entities (e.g., otherusers). In the example of FIG. 1, the consortium blockchain network 102is represented as a peer-to-peer network of nodes, and the computingsystems 106, 108 provide nodes of the first entity, and second entityrespectively, which participate in the consortium blockchain network102.

FIG. 2 depicts an example of an architecture 200 in accordance withembodiments of this specification. The example conceptual architecture200 includes participant systems 202, 204, 206 that correspond toParticipant A, Participant B, and Participant C, respectively. Eachparticipant (e.g., user, enterprise) participates in a blockchainnetwork 212 provided as a peer-to-peer network including a plurality ofnodes 214, at least some of which immutably record information in ablockchain 216. Although a single blockchain 216 is schematicallydepicted within the blockchain network 212, multiple copies of theblockchain 216 are provided, and are maintained across the blockchainnetwork 212, as described in further detail herein.

In the depicted example, each participant system 202, 204, 206 isprovided by, or on behalf of Participant A, Participant B, andParticipant C, respectively, and functions as a respective node 214within the blockchain network. As used herein, a node generally refersto an individual system (e.g., computer, server) that is connected tothe blockchain network 212, and enables a respective participant toparticipate in the blockchain network. In the example of FIG. 2, aparticipant corresponds to each node 214. It is contemplated, however,that a participant can operate multiple nodes 214 within the blockchainnetwork 212, and/or multiple participants can share a node 214. In someexamples, the participant systems 202, 204, 206 communicate with, orthrough the blockchain network 212 using a protocol (e.g., hypertexttransfer protocol secure (HTTPS)), and/or using remote procedure calls(RPCs).

Nodes 214 can have varying degrees of participation within theblockchain network 212. For example, some nodes 214 can participate inthe consensus process (e.g., as miner nodes that add blocks to theblockchain 216), while other nodes 214 do not participate in theconsensus process. As another example, some nodes 214 store a completecopy of the blockchain 216, while other nodes 214 only store copies ofportions of the blockchain 216. For example, data access privileges canlimit the blockchain data that a respective participant stores withinits respective system. In the example of FIG. 2, the participant systems202, 204, and 206 store respective, complete copies 216′, 216″, and216′″ of the blockchain 216.

A blockchain (e.g., the blockchain 216 of FIG. 2) is made up of a chainof blocks, each block storing data. Examples of data include transactiondata representative of a transaction between two or more participants.While transactions are used herein by way of non-limiting example, it iscontemplated that any appropriate data can be stored in a blockchain(e.g., documents, images, videos, audio). Examples of a transaction caninclude, without limitation, exchanges of something of value (e.g.,assets, products, services, currency). The transaction data is immutablystored within the blockchain. That is, the transaction data cannot bechanged.

Before storing in a block, the transaction data is hashed. Hashing is aprocess of transforming the transaction data (provided as string data)into a fixed-length hash value (also provided as string data). It is notpossible to un-hash the hash value to obtain the transaction data.Hashing ensures that even a slight change in the transaction dataresults in a completely different hash value. Further, and as notedabove, the hash value is of fixed length. That is, no matter the size ofthe transaction data the length of the hash value is fixed. Hashingincludes processing the transaction data through a hash function togenerate the hash value. An example of a hash function includes, withoutlimitation, the secure hash algorithm (SHA)-256, which outputs 256-bithash values.

Transaction data of multiple transactions are hashed and stored in ablock. For example, hash values of two transactions are provided, andare themselves hashed to provide another hash. This process is repeateduntil, for all transactions to be stored in a block, a single hash valueis provided. This hash value is referred to as a Merkle root hash, andis stored in a header of the block. A change in any of the transactionswill result in change in its hash value, and ultimately, a change in theMerkle root hash.

Blocks are added to the blockchain through a consensus protocol.Multiple nodes within the blockchain network participate in theconsensus protocol, and perform work to have a block added to theblockchain. Such nodes are referred to as consensus nodes. PBFT,introduced above, is used as a non-limiting example of a consensusprotocol. The consensus nodes execute the consensus protocol to addtransactions to the blockchain, and update the overall state of theblockchain network.

In further detail, the consensus node generates a block header, hashesall of the transactions in the block, and combines the hash value inpairs to generate further hash values until a single hash value isprovided for all transactions in the block (the Merkle root hash). Thishash is added to the block header. The consensus node also determinesthe hash value of the most recent block in the blockchain (i.e., thelast block added to the blockchain). The consensus node also adds anonce value, and a timestamp to the block header.

In general, PBFT provides a practical Byzantine state machinereplication that tolerates Byzantine faults (e.g., malfunctioning nodes,malicious nodes). This is achieved in PBFT by assuming that faults willoccur (e.g., assuming the existence of independent node failures, and/ormanipulated messages sent by consensus nodes). In PBFT, the consensusnodes are provided in a sequence that includes a primary consensus node,and backup consensus nodes. The primary consensus node is periodicallychanged. Transactions are added to the blockchain by all consensus nodeswithin the blockchain network reaching an agreement as to the worldstate of the blockchain network. In this process, messages aretransmitted between consensus nodes, and each consensus nodes provesthat a message is received from a specified peer node, and verifies thatthe message was not modified during transmission.

In PBFT, the consensus protocol is provided in multiple phases with allconsensus nodes beginning in the same state. To begin, a client sends arequest to the primary consensus node to invoke a service operation(e.g., execute a transaction within the blockchain network). In responseto receiving the request, the primary consensus node multicasts therequest to the backup consensus nodes. The backup consensus nodesexecute the request, and each sends a reply to the client. The clientwaits until a threshold number of replies are received. In someexamples, the client waits for f+1 replies to be received, where f isthe maximum number of faulty consensus nodes that can be toleratedwithin the blockchain network. The final result is that a sufficientnumber of consensus nodes come to an agreement on the order of therecord that is to be added to the blockchain, and the record is eitheraccepted, or rejected.

In some blockchain networks, cryptography is implemented to maintainprivacy of transactions. For example, if two nodes want to keep atransaction private, such that other nodes in the blockchain networkcannot discern details of the transaction, the nodes can encrypt thetransaction data. An example of cryptography includes, withoutlimitation, symmetric encryption, and asymmetric encryption. Symmetricencryption refers to an encryption process that uses a single key forboth encryption (generating ciphertext from plaintext), and decryption(generating plaintext from ciphertext). In symmetric encryption, thesame key is available to multiple nodes, so each node can en-/de-crypttransaction data.

Asymmetric encryption uses keys pairs that each include a private key,and a public key, the private key being known only to a respective node,and the public key being known to any or all other nodes in theblockchain network. A node can use the public key of another node toencrypt data, and the encrypted data can be decrypted using other node'sprivate key. For example, and referring again to FIG. 2, Participant Acan use Participant B's public key to encrypt data, and send theencrypted data to Participant B. Participant B can use its private keyto decrypt the encrypted data (ciphertext) and extract the original data(plaintext). Messages encrypted with a node's public key can only bedecrypted using the node's private key.

Asymmetric encryption is used to provide digital signatures, whichenables participants in a transaction to confirm other participants inthe transaction, as well as the validity of the transaction. Forexample, a node can digitally sign a message, and another node canconfirm that the message was sent by the node based on the digitalsignature of Participant A. Digital signatures can also be used toensure that messages are not tampered with in transit. For example, andagain referencing FIG. 2, Participant A is to send a message toParticipant B. Participant A generates a hash of the message, and then,using its private key, encrypts the hash to provide a digital signatureas the encrypted hash. Participant A appends the digital signature tothe message, and sends the message with digital signature to ParticipantB. Participant B decrypts the digital signature using the public key ofParticipant A, and extracts the hash. Participant B hashes the messageand compares the hashes. If the hashes are same, Participant B canconfirm that the message was indeed from Participant A, and was nottampered with.

In some instances, a smart contract executing within the blockchainnetwork requires input from outside of the blockchain network toevaluate pre-defined rules and perform corresponding actions. By way ofnon-limiting example, a stock quote might be needed for the smartcontract to base a decision on, the stock quote coming from a datasource external to the blockchain network. As another non-limitingexample, account information for an account that is maintained outsideof the blockchain network might be needed to for the smart contract tobase a decision on. However, the smart contract itself cannot directlyquery external data sources.

Traditional approaches include use of a relay agent to retrieve externaldata, and submit the data to the blockchain for processing by the smartcontract. This process, however, can result in security issues, such asleakage of secure information (e.g., credentials that might be requiredto access an external data source). For example, traditional approachescan use TEE to prove that the relay agent has performed the specifiedquery request honestly. However, and due to the openness of theblockchain, all query requests are visible to all users (nodes) in theblockchain network. Consequently, there is a risk of permission leakagefor query requests that require access to external data sourcesrequiring access control (e.g., queries). For example, there is a riskthat request strings can be intercepted, modified and replayed,resulting in information leakage, or other problems.

In one traditional approach that uses SGX, the TA, or portion of the TA,executing in an enclave (enclave program) functions as a relay node toaccess external data sources. For example, the enclave program can senda query request (e.g., HTTPS request) to an Internet-based data source,and can provide the response to the smart contract that initiated therequest. In some examples, a privacy field function is provided, whichcan be used encrypt sensitive information (e.g., access credentials)using the public key of the enclave. In some examples, the relay nodeuses the private key of the enclave to decrypt the privacy field,invokes the HTTPS client to access the target Internet-based datasource, receive the requested data, and use the private key to digitallysign the returned data. After the digital signature, the data isreturned to the smart contract that had initiated the request.

Such a traditional approach, however, has disadvantages. An exampledisadvantage of directly encrypting the privacy field is that therequest with the privacy field ciphertext does not have integrityprotection. For example, the user carries the encrypted API key field inthe request for requesting all authorization information of theInternet-based data source. An attacker can intercept the communication.Although the attacker cannot directly decrypt the plaintext of the APIkey information, the attacker can modify the request to use the sameprivacy field to construct a request for accessing information, and sendit to the relay node. This can result in leakage of sensitiveinformation (e.g., credentials).

In view of the above context, embodiments of the present specificationare directed to querying external data sources (e.g., Internet-baseddata sources) using a relay system and TEE. More particularly, and asdescribed in further detail herein, embodiments of this specificationprovide for authorization request integrity check, while protectingsensitive information (e.g., credentials). In this manner, and asdescribed in further detail herein, embodiments of this specificationaddress disadvantages of traditional approaches, such as preventing userrights from leaking.

FIG. 3 is a diagram illustrating an example of a system 300 inaccordance with embodiments of this specification. As shown, the system300 includes a developer server 302, a user device 304, a relay systemnode 306, an attestation service 308, and a network 310 (e.g.,Internet). In some embodiments, the relay system node 310 is implementedusing a TEE technology (e.g., Intel SGX). In general, the attestationservice 308 verifies a legitimacy of the relay system node 306 for theuser device 304. An example of an attestation service includes IAS,described above. Note that the system 300 is illustrated as includingone relay system node 306 for illustrative purpose only. The system 300may include any suitable number of relay system nodes 306.

The developer server 302 includes any suitable server, computer, module,or computing element to store and process codes and/or data related tothe relay system nodes 306. For example, the developer server 302 maystore a source code and a measurement value (e.g., a digest of aninitial state of the relay system node 306) of the relay system node306. As described herein, the developer server 302 is communicativelycoupled to the user device 304. For example, the developer server 302may send the measurement value of the relay system node 306 to the userdevice 304 upon request.

The user device 304 includes any suitable computer, processor, module,or computing element to enable a client to communicate with thedeveloper server 302, the relay system node 306, and the attestationservice 308. For example, the user device 304 may be used by a client torequest a data or service from the other components of system 300. Theuser device 304 can include a graphical user interface (GUI) for aclient to interact with the user device 304. In some embodiments, theuser device 304 requests an attestation evidence 320 from the relaysystem node 306. The attestation evidence 320 indicates a legitimacy ofthe relay system node 306 (e.g., whether the relay system node 306 is atrusted entity) and includes a measurement value 322, a public key 324,and a signature 326. The measurement value 322 may include a digest(e.g., a hash value) of an initial state of the relay system node 306.The public key 324 is associated with the relay system node 306 and canbe generated randomly with a private key of the relay system node 306.The signature 326 includes the measurement value 322 and the public key324 that is signed using an attestation key of the relay system node306.

In some embodiments, the attestation key of the relay system node 306includes an enhanced privacy identification (EPID) private key. EPID isan algorithm provided by Intel for attestation of a trusted system,while preserving privacy. In general, each of the members (e.g., acomputer or a server) of a network is assigned an EPID private key forsigning the attestation evidence, and a verifier of the attestationevidence in the network stores an EPID public key that is paired withthe EPID private keys of the other members of the network. Each of themembers can generate a signature of the attestation evidence using itsown EPID private key, and the verifier can verify the signatures of theother members using the EPID public key. As such, the EPID keys can beused to prove that a device, such as a computer or a server, is agenuine device.

The relay system node 306 includes any suitable server, computer,module, or computing element implemented using a TEE technology (e.g.,Intel SGX). The relay system node 306 may generate the attestationevidence 320 upon a request from the user device 304. The relay systemnode 306 can receive and handle data and/or service requests from theuser device 304, and query external data sources in the network 310, forexample such as, HTTPS-enabled Internet services. In some embodiments,the relay system node 306 is provisioned with a public key 324 and aprivate key that is paired with the public key 324. The public key 324and the paired private key can be used by the relay system node 306 forauthentication and encryption of the communication with the user device304. In some embodiments, the relay system node 306 is furtherprovisioned with an attestation key (e.g., an EPID private key) forsigning the attestation evidence 320. The attestation evidence 320signed with the EPID private key can be verified by the attestationservice 308 using an EPID public key.

The attestation service 308 includes any suitable server, computer,module, or computing element to verify the legitimacy of the attestationevidence 320. As noted above, the attestation evidence 320 includes themeasurement value 322, the public key 324, and the signature 326 of therelay system node 306. Upon receiving the attestation evidence 320, theattestation service 306 can verify the signature 326 and generate anattestation verification report (AVR) 330.

The attestation service 308 verifies the signature 326 in theattestation evidence 320 using an attestation key (e.g., an EPID publickey). After verifying the signature 326 using the EPID public key, theattestation service 308 generates the AVR 330 that includes theattestation evidence 320, a verification result 334 indicating whetherthe signature 326 in the attestation evidence 320 is valid, and asignature 336 of the attestation service 312.

In some embodiments, the AVR 330 includes the attestation evidence 320excluding the signature 326 of the relay system node 310. For example,the AVR 330 may include the measurement value 322 of the relay systemnode 306, the public key 324, the verification result 334, and thesignature 336. In some embodiments, the signature 336 includes theattestation evidence 320 and the verification result 334 that are signedusing a report signing key (e.g., a private key that the attestationservice 312 uses to sign the AVR).

In operation, the user device 304 receives the measurement value 322 ofthe relay system node 306 from the developer server 302. The user device304 queries the relay system node 306, receives the attestation evidence320, and sends the attestation evidence 320 to the attestation service308. The attestation service 308 verifies the attestation evidence 320and sends an AVR to the user device 304. The user device 304 verifiesthe AVR 330 based on the signature 336 and the measurement value 322 inthe AVR 330. Upon successfully verifying the AVR 330, the user device304 determines that the relay system node 306 is a trusted entity andregisters (e.g., stores) the public key 324 of the relay system node306. The verification of the attestation evidence 320 will be discussedbelow in greater detail with reference to FIG. 4.

FIG. 4 depicts an example of a signal flow 400 in accordance withembodiments of this specification. The signal flow 400 represents anattestation verification process. For convenience, the process will bedescribed as being performed by a system of one or more computers,located in one or more locations, and programmed appropriately inaccordance with this specification. For example, a distributed system(the system 300 of FIG. 3), appropriately programmed, can perform theprocess.

In the example of FIG. 4, the developer server 302 sends (402) ameasurement value 322 of the relay system node 306 to the user device304 upon a request from the user device 304. For example, the userdevice 304 may send a request to the developer server 302 for themeasurement values 322 of one of more relay system nodes 306. Uponverifying an identity of the user device, the developer server 302 cansend the requested measurement values 322 to the user device 304.

The user device 304 sends (404) an attestation request (e.g., achallenge) to the relay system node 306. The attestation request is sentto the relay system node 306 to request attestation evidence 320 thatindicates a legitimacy of the relay system node 306. In someembodiments, the attestation evidence 320 includes the measurement value322, the public key 324, and the signature 326 of the relay system node306.

In response to the attestation request, the relay system node 306generates (406) the attestation evidence 320. As noted above, theattestation evidence 320 indicates a legitimacy the relay system node306, and includes the measurement value 322, the public key 324, and thesignature 326 of the relay system node 306.

In some embodiments, the measurement value 322 may include a digest ofan initial state of the relay system node 306. For example, themeasurement value 322 may include a hash value of a process code that isimplemented on the relay system node 306. The public key 324 may begenerated randomly by the relay system node 306 along with a private keyusing a predetermined key generation algorithm, for example such as,Rivest-Shamir-Adleman (RSA) algorithm. In some examples, the public key324 is provided in the attestation evidence 320 and sent to the userdevice 304, and can be used for future communication between the userdevice 304 and the relay system node 306. For example, the relay systemnode 306 may use its private key to generate a signature of a queryresult and the user device 304 can use the public key 324 to verify thesignature. The signature 326 in the attestation evidence 320 includesthe measurement value 322 and the public key 324 that are signed usingan attestation key (e.g., an EPID private key) of the relay system node306.

The relay system node 306 sends (408) the attestation evidence 320 asgenerated above to the user device 304 in response to the attestationrequest from the user device 304.

The user device 304 forwards (410) the attestation evidence 320 from therelay system node 306 to the attestation service 308. In someembodiments, the user device 304 sends an attestation verificationrequest to the attestation service 308. The attestation verificationrequest includes the attestation evidence 320 of the relay system node306, and some supplemental information, such as, for example, adescriptor that indicates whether the relay system node 306 uses the SGXplatform service.

The attestation service 308 verifies (412) the attestation evidence 320in response to receiving the attestation evidence 320 forwarded by theuser device 304. As noted, the attestation evidence 320 includes themeasurement value 322, the public key 324, and the signature 326 of therelay system node 306. The signature 326 includes the measurement value322 and the public key 324 that are signed using an attestation key(e.g., EPID private key) of the relay system node 306. The attestationservice 308 may verify the attestation evidence 320 by verifying thesignature 326 in the attestation evidence 320 using an attestation key(e.g., EPID public key) of the attestation service 308.

If the attestation service 308 determines that the signature 326 in theattestation evidence 320 is valid, the attestation service 308determines that the relay system node 306 is a trusted entity. If theattestation service 308 determines that the signature 326 in theattestation evidence 320 is invalid, the attestation service 308determines that the relay system node 306 is not a trusted entity, andcan reject any subsequent data and requests from the relay system node306.

The attestation service 308 generates (414) an AVR 330 based on averification of the attestation evidence 320. In some embodiments, theAVR 330 can include the attestation evidence 320, an attestationverification result 334, and a digital signature 336 of the attestationservice 308. In some embodiments, the AVR 330 may include theattestation evidence 320 excluding the signature 326 of the relay systemnode 310. For example, the AVR 330 may include the measurement value322, the public key 324, the attestation verification result 334, andthe signature 336 of the attestation service 308.

The attestation verification result 334 in the AVR 330 indicates whetherthe signature 326 in the attestation evidence 320 is valid. For example,the attestation verification result 330 may include a value of “valid,”or “OK” that indicates the signature 326 in the attestation evidence 320is valid or a value of “invalid” that indicates the signature 326 isinvalid.

In some embodiments, the signature 336 of the attestation service 308 inAVR 330 includes the attestation evidence 320 and the attestationverification result 334 that are signed using a report signing key. Thereport signing key may be a private key that the attestation service 308uses to sign the AVR 330. In some embodiments, the report signing key isgenerated by the attestation service 308 using a predetermined keygenerated algorithm. For example, the report signing key may begenerated using the RSA-Secure Hash Algorithm (SHA) 256.

In some embodiments, the attestation service 308 sends (416) the AVR 330to the user device 304. As noted above, the AVR 330 includes acryptographically signed report of verification of identity of the relaysystem node 306, and can include the attestation evidence 320, anattestation verification result 335, and a digital signature 336 of theattestation service 308.

In some embodiments, the user device 304 verifies (418) the AVR 330 uponreceiving the AVR 330 from the attestation service 308. For example, theuser device 304 may verify the signature 336 of the attestation service308 in the AVR 330. In some embodiments, the user device 304 verifiesthe signature 336 in the AVR 330 using a report signing certificate. Thereport signing certificate may be an X.509 digital certificate. Thereport signing certificate can be paired with the report signing key theattestation service 312 uses to sign the AVR. If the user device 304verifies that the signature 336 of the attestation service 308 in theAVR 330 is valid, the user device 304 determines that the AVR 330 isindeed sent by the attestation service 308. If the user device 304determines that the signature 336 in the AVR 330 is invalid, the userdevice 304 determines that the AVR 330 is not genuine, and can rejectthe AVR 330. The user device 304 may further inspect the attestationverification result 334 in the AVR 330 to determine whether thesignature 326 in the attestation evidence 320 is valid.

In some embodiments, the user device 304 further compares themeasurement value 322 in the attestation evidence 320 with a measurementvalue 322 that is previously obtained from the developer server 302 todetermine whether the attestation evidence 320 is valid.

The user device 304 registers (420) the relay system node 306 as atrusted entity in response to determining that the AVR 330 is genuine.For example, the user device 304 can deem the relay system node 306 tobe trustworthy if the measurement value 322 in AVR 330 matches themeasurement value 322 previously obtained from the developer server 302,the verification result 334 indicates the signature 326 is valid, and/orsignature 336 is verified to be valid. The user device 304 may furtherstore the public key 324 that is included in the attestation evidence320 in the AVR 330. The public key 324 will be used by the user device304 for authentication and encryption of future communication betweenthe user device 304 and the relay system node 306.

FIG. 5 is a diagram illustrating an example of a system 500 inaccordance with embodiments of this specification. As shown, system 500includes a user device 502, a blockchain 504, a relay system node 510,and a network 514 (e.g., Internet). In the depicted example, theblockchain 504 includes a client smart contract 506 and a relay systemsmart contract 508. In some embodiments, the relay system node 510 isimplemented using a TEE technology (e.g., Intel SGX). In general, theuser device 502 requests data from a data source in the network 512 andreceives retrieved data from the data source through the blockchain 504and the relay system node 510 such that an integrity of the request andretrieved data can be verified. The relay system of FIG. 5 (e.g., therelay system smart contract 508, the relay system node 510) facilitatesavoiding direct contact between the user device 502 and the relay systemnode, thereby avoiding exposing a position or access point of the relaysystem node. As such, the relay system node is less likely to be foundand attacked by malicious actors over the network using, for example,distributed denial of service (DDoS) attacks. This improves a securityof the relay system node, thereby further improving a security of thecommunication between the blockchain and the relay system node.

The user device 502, the relay system node 510 and the network 512 canbe the same components as the user device 304, the relay system node306, and the network 310 as depicted in FIG. 3, respectively. The clientsmart contract 506 is a smart contract that operates as a requester foran off-chain client (e.g., the user device 502) to request data orservice from the network 512. The client smart contract 304 iscommunicatively coupled to the relay system contract 508 within theblockchain 504. The relay system smart contract 508 includes or operatesas an application program interface (API) to the client smart contract506 for processing and handling data transmitted between the clientsmart contract 506 and the relay system node 510. The client smartcontract 506, the relay system smart contract 508, and the relay systemnode 510 operate together as a relay system to relay requests from theuser device 502 to the network 512 and relay request results from thenetwork 512 to the user device 502.

In operation, the user device 502 generates a request that will berelayed to the relay system node 510 through the client smart contract506 and the relay system smart contract 508. The request is generated bythe user device 502 as including an encrypted hash value such that therelay system node 510 can verify an integrity of the request based onthe encrypted hash value. The verification of the request will bediscussed below in greater detail with reference to FIG. 6.

FIG. 6 depicts an example of a signal flow 600 in accordance withembodiments of this specification. The signal flow 600 represents aprocess for verifying requests sent to an external data source inaccordance with embodiments of the present disclosure. For convenience,the process will be described as being performed by a system of one ormore computers, located in one or more locations, and programmedappropriately in accordance with this specification. For example, adistributed system (e.g., the blockchain system 100 of FIG. 1; thesystem 500 of FIG. 5), appropriately programmed, can perform theprocess.

The user device 502 generates (602) a request for data or service fromthe Internet-based data source 512. For example, the request may be anaccess request for an account of a client and the client can operate theuser device 502 to generate the access quest. The access request mayinclude a plaintext portion, such as, for example, a web address, and aconfidential data portion, such as, for example, credentials (e.g., auser name, a password) of the account of the user 502. The confidentialdata portion in the access request can be encrypted, such that maliciousactors over the network cannot obtain the personal information of theuser account to infiltrate the user account. However, the confidentialdata portion, although still encrypted, may be obtained by the maliciousactors and combined with a different plaintext portion, such as, forexample, a second web address. For example, the second web address canbe under the same domain of the first web address, and the encrypted,confidential data portion could be used to access personal data of theclient on the second web address (e.g., such an attack would besuccessful, if the client uses the same user name and password on thesecond web address as the first web address).

As described herein, embodiments of this specification mitigate suchattacks by improving the integrity of the requests. In some embodiments,to improve integrity of the request and security of personal data, therequest generated by the user device 502 includes a plaintext dataelement, and an encrypted combination of a confidential data element anda hash value of the plaintext data element. For example, user device 502may compute a hash value of the plaintext data element and concatenatethe hash value to the confidential data element. The user device 502 mayfurther encrypt the concatenated hash value and the confidential dataelement using a public key that is previously generated and sent to theuser device 502 by the relay system node 510. For example:R→[P,PK_(RSN)(C∥H)]where:

-   -   R is the request issued by the computing device of the user to        the blockchain network,    -   P is a plaintext portion (e.g., URL of data source that is to be        queried);    -   PK_(RSN) is the public key of the relay system node that queries        the data source;    -   C is the confidential information (e.g., credentials) used to        access the data source;    -   H is the hash of the plaintext portion P; and    -   ∥ represents concatenation of C and H, which concatenation is        encrypted using PK_(RSN).        The encrypted concatenation of the hash value and the        confidential data element can be decrypted by the relay system        node 510 using a private key that is paired with the public key.

In some embodiments, the user device 502 encrypts the hash value and theconfidential data element separately using the public key. For example,the user device 502 may encrypt the hash value using the public key andencrypt the confidential data element using the public key. The userdevice 502 combines (e.g., concatenates) the encrypted hash value andthe encrypted confidential data element. For example:R→[P,(PK_(RSN)(C)∥PK_(RSN)(H))]where:

-   -   R is the request issued by the computing device of the user to        the blockchain network,    -   P is a plaintext portion (e.g., URL of data source that is to be        queried);    -   PK_(RSN) is the public key of the relay system node that queries        the data source;    -   C is the confidential information (e.g., credentials) used to        access the data source;    -   H is the hash of the plaintext portion P; and    -   ∥ represents concatenation of encrypted C and encrypted H, which        are each encrypted using PK_(RSN).        The encrypted of the hash value and the encrypted confidential        data element of the concatenation can be decrypted by the relay        system node 510 using the private key that is paired with the        public key.

The user device 502 sends (604) the request to the client smart contract506. For example, user device 502 may submit the request to blockchain504, and the blockchain 504 assigns the request to the client smartcontract 506 that is associated with user device 502. The client smartcontract 506 forwards (606) the request to the relay system smartcontract 508 after receiving the request from user device 502. The relaysystem smart contract 508 forwards (608) the request to the relay systemnode 510 after receiving the request from the client smart contract 506.

In some embodiments, the relay system node 510 obtains (610) theconfidential data element and the hash value of the plaintext dataelement from the request using a private key of the relay system node510. As noted above, the request includes a plaintext data element, anda combination of a confidential data element and a hash value of theplaintext data element that is encrypted using a public key of the relaysystem node 510. The relay system node 510 stores a private key that ispaired with the public key the user device 502 uses to encrypt the hashvalue of the plaintext text data element and the confidential dataelement in the request. The relay system node 510 can use the privatekey to decrypt the encrypted combination of the hash value and theconfidential data element to obtain the hash value of the plaintext dataelement and the confidential data element.

The relay system node 510 computes (612) a hash value of the plaintextdata element in the request. For example, the relay system node 510 mayobtain the plaintext data element in the request and apply apredetermined hash function to the plaintext data element to computerthe hash value of the plaintext data element. The relay system node 510compares (614) the hash value of the plaintext data element asdetermined at 612 with the hash value of the plaintext data element asobtained at 610. The relay system node 510 determines whether the twohash values match. If the hash values match, the relay system node 510determines that the plaintext data element in the request has not beentampered. If the two hash values do not match, the relay system node 510may determine that the plaintext data element has been tampered with(e.g., by a malicious actor).

The relay system node 510 verifies (616) whether the request is genuinebased on the comparison of the two hash values as performed at 614. Forexample, if the hash value of the plaintext data element as determinedat 612 matches the hash value of the plaintext data element as obtainedat 610, the relay system node 510 determines that the request is intact(e.g., not tampered with). If the two hash values do not match, therelay system node 510 determines that the request has been tamperedwith, or is otherwise not intact. If the relay system node 510determines that the request is not intact, the relay system node 510 mayreject the request and will not query the Internet-based data source512.

In some embodiments, in response to determining that the request isintact, the relay system node 510 sends (618) the request to theInternet-based data source 512 to obtain a request result. In someembodiments, the relay system node 510 constructs a new request thatincludes the plaintext data element and the confidential data elementand queries the Internet-based data source 512 using the new request.For example, the new request may include a plaintext data elementincluding a web address where the user device 502 wants to access anaccount, and a confidential data element including credentials (e.g.,user name and password) of the user device 502 to log into the account.In some examples, the Internet-based data source 512 processes (620) therequest, and returns (622) a request result to the relay system node510.

The relay system node 510 signs (624) the request result that isreceived from the Internet-based data source 512, and sends (626) thesigned request result to the relay system smart contract 508. Forexample, the relay system node 510 may generate a signature thatincludes the request result that is signed using the private key of therelay system node 510. The private key that the relay system node 510uses to sign the request result is the same as the private key that therelay system node 510 previously used to decrypt the encryptedconfidential data element and hash value of the plaintext data elementin the request. The relay system node 510 may combine (e.g.,concatenate) the signature with the request result and send them to therelay system smart contract 508. In some embodiments, the relay systemnode 510 computes a hash value of the request result and signs the hashvalue using the private key of the relay system node 510. The relaysystem node 510 combines the request result with the signed hash valueof the request result. In this manner, the user device 502 can verifythe request result by extracting the hash value of the request resultusing its public key, computing a hash value of the request result, anddetermining whether the two hash values match, as described herein.

The relay system smart contract 508 forwards (628) the request result tothe client smart contract 506. The client smart contract 506 provides(630) the request result to the user device 502.

In some embodiments, the user device 502 verifies (632) the signedrequest by verifying the signature included in the signed request resultusing its public key. For example, if the signed request result includesthe request result and a signed hash value of the request result, theuser device 502 may obtain the hash value of the request result usingits public key, computing a hash value of the request result, anddetermining whether the two hash values match. If the two hash valuesmatch, the user device 502 determines that the request result is valid.If the two hash values do not match, the user device 502 determines thatthe request result is invalid and may reject the request result.

FIG. 7 depicts an example of a process 700 that can be executed inaccordance with embodiments of this specification. In some embodiments,the example process 700 may be performed using one or morecomputer-executable programs executed using one or more computingdevices. In some examples, the process 700 can be performed by a relaysystem for retrieving data that is external to a blockchain network(e.g., the client smart contract 506, the relay system smart contract508, and the relay system node 510 of FIG. 5).

A request is received (702). For example, the relay system node 510 ofFIG. 5 receives the request, which originated from the user device 502of FIG. 5. In some examples, and as described herein, the user device502 generates the request to include a first portion and a secondportion, the first portion including plaintext data and the secondportion including encrypted data, the encrypted data including accessdata and a first hash value, the first hash value being generated as ahash of the plaintext data using a public key of the relay system node510. The client smart contract 506 and the relay system smart contract508 forwards the request to the relay system node 510.

Plaintext is determined (704). For example, the relay system node 510decrypts the encrypted data using its private key to determine the firsthash value (as plaintext). A hash is computed (706). For example, therelay system node 510 processes the plaintext data of the first portionto provide a second hash value. It is determined whether the request isvalid (708). For example, the relay system node 510 compares the firsthash value and the second hash value. If the first hash value is thesame as the second hash value, the request is valid. That is, it isdetermined that the integrity of the request is intact. If the firsthash value is not the same as the second hash value, the request isinvalid. That is, it is determined that the integrity of the request hasbeen compromised. If the request is not valid, an error is indicated(710), and the example process 700 ends.

If the request is valid, a query is sent to the data source (712). Forexample, the relay system node 510 constructs the query (e.g., newrequest) that includes the plaintext data element and the confidentialdata element of the request it had received (e.g., original request).For example, the new request may include a plaintext data elementincluding a web address where the user device 502 wants to access anaccount, and a confidential data element including credentials (e.g.,user name and password) of the user device 502 to log into the account.The relay system node 510 queries the Internet-based data source 512using the query.

A result is received from the data source (714). In some examples, theInternet-based data source 512 processes the request, and returns arequest result (e.g., data value(s)) to the relay system node 510. Aresponse is prepared (716), and the response is sent (718). For example,the relay system node 510 may generate a signature that includes therequest result that is signed using the private key of the relay systemnode 510. The private key that the relay system node 510 uses to signthe request result is the same as the private key that the relay systemnode 510 previously used to decrypt the encrypted data in the originalrequest. The relay system node 510 may combine (e.g., concatenate) thesignature with the request result and send them to the relay systemsmart contract 508. In some embodiments, the relay system node 510computes a hash value of the request result and signs the hash valueusing the private key. The relay system node 510 combines the requestresult with the signed hash value of the request result.

A hash is computed (720). For example, the user device 502 calculates ahash value based on the request result (e.g., data value(s)). It isdetermined whether the response is valid (722). For example, the userdevice 502 obtains the hash value of the request result using the publickey, and determines whether it matches the computed hash value. If thetwo hash values match, the user device 502 determines that the requestresult is valid. If the two hash values do not match, the user device502 determines that the request result is invalid and may reject therequest result. If the request is not valid, an error is indicated(724), and the example process 700 ends. If the request is valid, theintegrity of the request result is intact, and the request result isprovided to the user device 502 for further processing.

FIG. 8 depicts examples of modules of an apparatus 800 in accordancewith embodiments of this specification. The apparatus 800 can be anexample embodiment of a user computing device. In some examples, theuser computing device issues requests to and receives responses from oneor more components of a relay system that are external to the blockchainnetwork, and that query data sources that are external to the blockchainnetwork.

The apparatus 800 can correspond to the embodiments described above, andthe apparatus 800 includes the following: a generating module 802 thatgenerates a request for data from the data source, the request includinga first portion and a second portion, the first portion includingplaintext data and the second portion including encrypted data, theencrypted data including access data and a first hash value, the firsthash value being generated as a hash of the plaintext data by a usercomputing device that submits the request; a transmitting module 804that transmits the request to a relay system component external to theblockchain network; a receiving module 806 that receives a result fromthe relay system component, the result including result data and asecond hash value, the result data being retrieved using the access dataand the second hash value being generated based on the result data anddigitally signed using a private key of the relay system component; anda verifying module 808 that verifies an integrity of the result based ona public key of the relay system component, a digital signature of theresult and the second hash value.

The system, apparatus, module, or unit illustrated in the previousembodiments can be implemented by using a computer chip or an entity, orcan be implemented by using a product having a certain function. Atypical embodiment device is a computer, and the computer can be apersonal computer, a laptop computer, a cellular phone, a camera phone,a smartphone, a personal digital assistant, a media player, a navigationdevice, an email receiving and sending device, a game console, a tabletcomputer, a wearable device, or any combination of these devices.

For an embodiment process of functions and roles of each module in theapparatus, references can be made to an embodiment process ofcorresponding steps in the previous method. Details are omitted here forsimplicity.

Because an apparatus embodiment basically corresponds to a methodembodiment, for related parts, references can be made to relateddescriptions in the method embodiment. The previously describedapparatus embodiment is merely an example. The modules described asseparate parts may or may not be physically separate, and partsdisplayed as modules may or may not be physical modules, may be locatedin one position, or may be distributed on a number of network modules.Some or all of the modules can be selected based on actual demands toachieve the objectives of the solutions of the specification. A personof ordinary skill in the art can understand and implement theembodiments of the present application without creative efforts.

Referring again to FIG. 8, it can be interpreted as illustrating aninternal functional module and a structure of a blockchain dataretrieving apparatus. The blockchain data retrieving apparatus can be anexample of a user computing device. An execution body in essence can bean electronic device, and the electronic device includes the following:one or more processors; and one or more computer-readable memoriesconfigured to store an executable instruction of the one or moreprocessors. In some embodiments, the one or more computer-readablememories are coupled to the one or more processors and have programminginstructions stored thereon that are executable by the one or moreprocessors to perform algorithms, methods, functions, processes, flows,and procedures, as described in this specification.

The techniques described in this specification produce one or moretechnical effects. In some embodiments, the integrity of requestssubmitted by a user computing device to relay system nodes for queryingdata sources that are external to a blockchain network are ensure. Insome embodiments, the integrity of responses provided back to theblockchain network from the external data sources is ensured.Accordingly, embodiments of the present disclosure improve the integrityof communications between a user computing device and a relay systemnode through a blockchain network. In this manner, potential attackchannels for malicious users are mitigated to enhance security.

Described embodiments of the subject matter can include one or morefeatures, alone or in combination: the relay system component decryptsthe encrypted data using the private key to provide the first hashvalue, calculates a hash value based on the plaintext data included inthe request, and compares the first hash value to the hash value toverify that the plaintext data is absent any change in response toreceiving the request; the relay system component transmits a queryrequest to the data source in response to verifying the request; therelay system component includes a relay system node that receives therequest from a relay system smart contract executing within theblockchain network; the plaintext data include a uniform resourcelocator (URL) of the data source; the relay system component executes atrusted execution environment (TEE), and the private key and the publickey of the relay system component are provisioned during an attestationprocess of the TEE; the user computing device executes the attestationprocess with the relay system node and an attestation service; and thedata source includes an Internet-based data source.

Embodiments of the subject matter and the actions and operationsdescribed in this specification can be implemented in digital electroniccircuitry, in tangibly-embodied computer software or firmware, incomputer hardware, including the structures disclosed in thisspecification and their structural equivalents, or in combinations ofone or more of them. Embodiments of the subject matter described in thisspecification can be implemented as one or more computer programs, e.g.,one or more modules of computer program instructions, encoded on acomputer program carrier, for execution by, or to control the operationof, data processing apparatus. For example, a computer program carriercan include one or more computer-readable storage media that haveinstructions encoded or stored thereon. The carrier may be a tangiblenon-transitory computer-readable medium, such as a magnetic, magnetooptical, or optical disk, a solid state drive, a random access memory(RAM), a read-only memory (ROM), or other types of media. Alternatively,or in addition, the carrier may be an artificially generated propagatedsignal, e.g., a machine-generated electrical, optical, orelectromagnetic signal that is generated to encode information fortransmission to suitable receiver apparatus for execution by a dataprocessing apparatus. The computer storage medium can be or be part of amachine-readable storage device, a machine-readable storage substrate, arandom or serial access memory device, or a combination of one or moreof them. A computer storage medium is not a propagated signal.

A computer program, which may also be referred to or described as aprogram, software, a software application, an app, a module, a softwaremodule, an engine, a script, or code, can be written in any form ofprogramming language, including compiled or interpreted languages, ordeclarative or procedural languages; and it can be deployed in any form,including as a stand-alone program or as a module, component, engine,subroutine, or other unit suitable for executing in a computingenvironment, which environment may include one or more computersinterconnected by a data communication network in one or more locations.

A computer program may, but need not, correspond to a file in a filesystem. A computer program can be stored in a portion of a file thatholds other programs or data, e.g., one or more scripts stored in amarkup language document, in a single file dedicated to the program inquestion, or in multiple coordinated files, e.g., files that store oneor more modules, sub programs, or portions of code.

Processors for execution of a computer program include, by way ofexample, both general- and special-purpose microprocessors, and any oneor more processors of any kind of digital computer. Generally, aprocessor will receive the instructions of the computer program forexecution as well as data from a non-transitory computer-readable mediumcoupled to the processor.

The term “data processing apparatus” encompasses all kinds ofapparatuses, devices, and machines for processing data, including by wayof example a programmable processor, a computer, or multiple processorsor computers. Data processing apparatus can include special-purposelogic circuitry, e.g., an FPGA (field programmable gate array), an ASIC(application specific integrated circuit), or a GPU (graphics processingunit). The apparatus can also include, in addition to hardware, codethat creates an execution environment for computer programs, e.g., codethat constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, or a combination of one or moreof them.

The processes and logic flows described in this specification can beperformed by one or more computers or processors executing one or morecomputer programs to perform operations by operating on input data andgenerating output. The processes and logic flows can also be performedby special-purpose logic circuitry, e.g., an FPGA, an ASIC, or a GPU, orby a combination of special-purpose logic circuitry and one or moreprogrammed computers.

Computers suitable for the execution of a computer program can be basedon general or special-purpose microprocessors or both, or any other kindof central processing unit. Generally, a central processing unit willreceive instructions and data from a read only memory or a random accessmemory or both. Elements of a computer can include a central processingunit for executing instructions and one or more memory devices forstoring instructions and data. The central processing unit and thememory can be supplemented by, or incorporated in, special-purpose logiccircuitry.

Generally, a computer will also include, or be operatively coupled toreceive data from or transfer data to one or more storage devices. Thestorage devices can be, for example, magnetic, magneto optical, oroptical disks, solid state drives, or any other type of non-transitory,computer-readable media. However, a computer need not have such devices.Thus, a computer may be coupled to one or more storage devices, such as,one or more memories, that are local and/or remote. For example, acomputer can include one or more local memories that are integralcomponents of the computer, or the computer can be coupled to one ormore remote memories that are in a cloud network. Moreover, a computercan be embedded in another device, e.g., a mobile telephone, a personaldigital assistant (PDA), a mobile audio or video player, a game console,a Global Positioning System (GPS) receiver, or a portable storagedevice, e.g., a universal serial bus (USB) flash drive, to name just afew.

Components can be “coupled to” each other by being commutatively such aselectrically or optically connected to one another, either directly orvia one or more intermediate components. Components can also be “coupledto” each other if one of the components is integrated into the other.For example, a storage component that is integrated into a processor(e.g., an L2 cache component) is “coupled to” the processor.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on, orconfigured to communicate with, a computer having a display device,e.g., a LCD (liquid crystal display) monitor, for displaying informationto the user, and an input device by which the user can provide input tothe computer, e.g., a keyboard and a pointing device, e.g., a mouse, atrackball or touchpad. Other kinds of devices can be used to provide forinteraction with a user as well; for example, feedback provided to theuser can be any form of sensory feedback, e.g., visual feedback,auditory feedback, or tactile feedback; and input from the user can bereceived in any form, including acoustic, speech, or tactile input. Inaddition, a computer can interact with a user by sending documents toand receiving documents from a device that is used by the user; forexample, by sending web pages to a web browser on a user's device inresponse to requests received from the web browser, or by interactingwith an app running on a user device, e.g., a smartphone or electronictablet. Also, a computer can interact with a user by sending textmessages or other forms of message to a personal device, e.g., asmartphone that is running a messaging application, and receivingresponsive messages from the user in return.

This specification uses the term “configured to” in connection withsystems, apparatus, and computer program components. For a system of oneor more computers to be configured to perform particular operations oractions means that the system has installed on it software, firmware,hardware, or a combination of them that in operation cause the system toperform the operations or actions. For one or more computer programs tobe configured to perform particular operations or actions means that theone or more programs include instructions that, when executed by dataprocessing apparatus, cause the apparatus to perform the operations oractions. For special-purpose logic circuitry to be configured to performparticular operations or actions means that the circuitry has electroniclogic that performs the operations or actions.

While this specification contains many specific embodiment details,these should not be construed as limitations on the scope of what isbeing claimed, which is defined by the claims themselves, but rather asdescriptions of features that may be specific to particular embodiments.Certain features that are described in this specification in the contextof separate embodiments can also be realized in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiments can also be realized in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially be claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claim may be directed to a subcombination orvariation of a subcombination.

Similarly, while operations are depicted in the drawings and recited inthe claims in a particular order, this should not be understood asrequiring that such operations be performed in the particular ordershown or in sequential order, or that all illustrated operations beperformed, to achieve desirable results. In certain circumstances,multitasking and parallel processing may be advantageous. Moreover, theseparation of various system modules and components in the embodimentsdescribed above should not be understood as requiring such separation inall embodiments, and it should be understood that the described programcomponents and systems can generally be integrated together in a singlesoftware product or packaged into multiple software products.

Particular embodiments of the subject matter have been described. Otherembodiments are within the scope of the following claims. For example,the actions recited in the claims can be performed in a different orderand still achieve desirable results. As one example, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In some cases, multitasking and parallel processing may beadvantageous.

What is claimed is:
 1. A computer-implemented method for retrieving datafrom a data source that is external to a blockchain network, the methodcomprising: generating, by a user computing device, a request for datafrom the data source, the request comprising a first portion and asecond portion, the first portion comprising plaintext data and thesecond portion comprising encrypted data, the encrypted data comprisinga concatenated data element encrypted using a public key of a relaysystem component, the concatenated data element comprising access datathat is concatenated to a first hash value of the plaintext data;transmitting, by the user computing device, the request to the relaysystem component through the blockchain network; and receiving, by theuser computing device, result data from the relay system componentthrough the blockchain network, the result data being retrieved usingthe access data and digitally signed using a private key of the relaysystem component.
 2. The computer-implemented method of claim 1, whereinthe request is configured to cause the relay system component to:decrypt the encrypted data using a private key of the relay systemcomponent to provide the first hash value; calculate a second hash valuebased on the plaintext data included in the request; compare the firsthash value to the second hash value to determine that the first hashvalue is identical to the second hash value; and transmit a resultresponsive to determining that the first hash value is identical to thesecond hash value, the result comprising the result data.
 3. Thecomputer-implemented method of claim 2, wherein the result furthercomprises a third hash value, and wherein the third hash value isgenerated based on the result data.
 4. The computer-implemented methodof claim 3, further comprising: verifying, by the user computing device,an integrity of the result based on the public key of the relay systemcomponent, a digital signature of the result, and the third hash value.5. The method of claim 1, wherein the relay system component comprises arelay system node that receives the request from a relay system smartcontract executing within the blockchain network.
 6. The method of claim1, wherein the plaintext data comprises a uniform resource locator (URL)of the data source.
 7. The method of claim 1, wherein the relay systemcomponent executes a trusted execution environment (TEE), and whereinthe private key and the public key of the relay system component areprovisioned during an attestation process of the TEE.
 8. Anon-transitory, computer-readable storage medium storing instructionsexecutable by a computer system and that upon such execution cause thecomputer system to perform operations for retrieving data from a datasource that is external to a blockchain network, the operationscomprising: generating a request for data from the data source, therequest comprising a first portion and a second portion, the firstportion comprising plaintext data and the second portion comprisingencrypted data, the encrypted data comprising a concatenated dataelement encrypted using a public key of a relay system component, theconcatenated data element comprising access data that is concatenated toa first hash value of the plaintext data; transmitting the request tothe relay system component through the blockchain network; and receivingresult data from the relay system component through the blockchainnetwork, the result data being retrieved using the access data anddigitally signed using a private key of the relay system component. 9.The non-transitory, computer-readable storage medium of claim 8, whereinthe request is configured to cause the relay system component to:decrypt the encrypted data using a private key of the relay systemcomponent to provide the first hash value; calculate a second hash valuebased on the plaintext data included in the request; compare the firsthash value to the second hash value to determine that the first hashvalue is identical to the second hash value; and transmit a resultresponsive to determining that the first hash value is identical to thesecond hash value, the result comprising the result data.
 10. Thenon-transitory, computer-readable storage medium of claim 9, wherein theresult further comprises a third hash value, and wherein the third hashvalue is generated based on the result data.
 11. The non-transitory,computer-readable storage medium of claim 10, wherein the operationsfurther comprise: verifying an integrity of the result based on thepublic key of the relay system component, a digital signature of theresult, and the third hash value.
 12. The non-transitory,computer-readable storage medium of claim 8, wherein the relay systemcomponent comprises a relay system node that receives the request from arelay system smart contract executing within the blockchain network. 13.The non-transitory, computer-readable storage medium of claim 8, whereinthe plaintext data comprises a uniform resource locator (URL) of thedata source.
 14. The non-transitory, computer-readable storage medium ofclaim 8, wherein the relay system component executes a trusted executionenvironment (TEE), and wherein the private key and the public key of therelay system component are provisioned during an attestation process ofthe TEE.
 15. A computer-implemented system, comprising: one or morecomputers; and one or more computer memory devices interoperably coupledwith the one or more computers and having tangible, non-transitory,machine-readable media storing instructions that, when executed by theone or more computers, cause the one or more computers to performoperations for retrieving data from a data source that is external to ablockchain network, the operations comprising: generating a request fordata from the data source, the request comprising a first portion and asecond portion, the first portion comprising plaintext data and thesecond portion comprising encrypted data, the encrypted data comprisinga concatenated data element encrypted using a public key of a relaysystem component, the concatenated data element comprising access datathat is concatenated to a first hash value of the plaintext data;transmitting the request to the relay system component through theblockchain network; and receiving result data from the relay systemcomponent through the blockchain network, the result data beingretrieved using the access data and digitally signed using a private keyof the relay system component.
 16. The computer-implemented system ofclaim 15, wherein the request is configured to cause the relay systemcomponent to: decrypt the encrypted data using a private key of therelay system component to provide the first hash value; calculate asecond hash value based on the plaintext data included in the request;compare the first hash value to the second hash value to determine thatthe first hash value is identical to the second hash value; and transmita result responsive to determining that the first hash value isidentical to the second hash value, the result comprising the resultdata.
 17. The computer-implemented system of claim 16, wherein theresult further comprises a third hash value, and wherein the third hashvalue is generated based on the result data.
 18. Thecomputer-implemented system of claim 17, wherein the operations furthercomprise: verifying an integrity of the result based on the public keyof the relay system component, a digital signature of the result, andthe third hash value.
 19. The computer-implemented system of claim 15,wherein the relay system component comprises a relay system node thatreceives the request from a relay system smart contract executing withinthe blockchain network.
 20. The computer-implemented system of claim 15,wherein the plaintext data comprises a uniform resource locator (URL) ofthe data source.